const state = {
	mainId: -1, //品牌id
	mainText: null, //品牌名称
	subId: -1, //子品牌id
	subText: null, //子品牌文本
}

const mutations = {
	SET_CARMAKEINFO: (state, info) => {
		state.mainId = info.mainId;
		state.mainText=info.mainText;
		state.subId = info.subId;
		state.subText=info.subText;
	},
    CLEAR_CARMAKEINFO: (state) => {
        state.mainId = -1;
        state.mainText=null;
        state.subId = -1;
        state.subText=null;
    }
}

const actions = {
	// 设置主品牌
	carMakeInfoSet({commit}, info) {
		return new Promise(resolve => {
			commit('SET_CARMAKEINFO', info);
			resolve()
		})
	},
    clearMakeInfoSet({commit}) {
		return new Promise(resolve => {
			commit('CLEAR_CARMAKEINFO');
			resolve()
		})
	}
}

export default {
	namespaced: true,
	state,
	mutations,
	actions
}
